<script setup>
import { reactive, toRefs } from 'vue'

const user = reactive({
  name: '老韩',
  age: 20
})
const {name, age} = toRefs(user)
console.log(name.value);
</script>

<template>
  <div>
    姓名: {{ name }}
    年龄: {{ age }}
  </div>
  <button @click="age++">长一岁</button>
</template>

<style scoped></style>
